/*********************************************************************************
* Copyright (c) zhujinyang.
* All rights reserved.
*
* \file
*
* os error handle
*
* 
*********************************************************************************/
#ifndef CC_ERROR_H
#define CC_ERROR_H



#define CC_ASSERT(exp)                                       \
do {                                                         \
    if (!(exp)) {                                            \
    	cc_error(__FILE__, __LINE__);                       \
    }                                                        \
} while(0)



#define CC_RESET()                                           \
do {                                                         \
        cc_error(__FILE__, __LINE__);                       \
} while(0)





/**********************************************************************************
* \brief:       handle assert callback
* \param[in]:   filename:  assert file name
* \param[in]:   line:  the line of assert
* \return:      none
**********************************************************************************/
void cc_error(char *filename, INT32U line);


/**********************************************************************************
* \brief:       handle assert callback
* \param[in]:   filename:  assert file name
* \param[in]:   line:  the line of assert
* \return:      none
**********************************************************************************/
void os_error_only_printf(char *filename, INT32U line);

/**********************************************************************************
* \brief:       register assert hanlde callback
* \param[in]:   hanlder:  callback function
* \return:      0 : success, -1 : failure
**********************************************************************************/
INT32S cc_error_register_handler(void (*handler)(char *filename, INT32U line));

#endif

